using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

namespace Deferred.Pipeline
{
    /// <summary>
    /// This class will be instantiated by the XNA Framework Content Pipeline
    /// to write the specified data type into binary .xnb format.
    ///
    /// This should be part of a Content Pipeline Extension Library project.
    /// </summary>
    [ContentTypeWriter]
    public class DeferredModelMeshWriter : ContentTypeWriter<DeferredModelMeshContent>
    {
        protected override void Write(ContentWriter output, DeferredModelMeshContent value)
        {
            output.Write(value.meshParts.Count);
            foreach (DeferredModelMeshPartContent part in value.meshParts)
            {
                output.WriteObject(part);
            }
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return "Deferred.Library.Scene.Graphics.DeferredModelMeshReader, Deferred.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ccaf9a8693b4a48c";
        }
    }
}
